import {nanoid} from "nanoid";
import {setItem,getItem} from "@/utils/localStorage";

const userTempIdType = "userTempId";

function userTempId(){
  if(getItem(userTempIdType)){
    return getItem(userTempIdType)
  }
  
  const userTempId = nanoid();
  setItem(userTempIdType,userTempId)

  return userTempId
}

export default userTempId